<?php

namespace common\models\kingdee;

use Yii;

/**
 * This is the model class for table "T_ORG_CTRLUNIT".
 *
 * @property string $FID
 * @property string $FNAME_L1
 * @property string $FNAME_L2
 * @property string $FNAME_L3
 * @property string $FNUMBER
 * @property string $FDESCRIPTION_L1
 * @property string $FDESCRIPTION_L2
 * @property string $FDESCRIPTION_L3
 * @property string $FSIMPLENAME
 * @property integer $FISGROUPING
 * @property string $FEFFECTDATE
 * @property string $FINVALIDDATE
 * @property integer $FISFREEZE
 * @property integer $FISCOMPANYORGUNIT
 * @property integer $FISADMINORGUNIT
 * @property integer $FISSALEORGUNIT
 * @property integer $FISPURCHASEORGUNIT
 * @property integer $FISSTORAGEORGUNIT
 * @property integer $FISPROFITORGUNIT
 * @property integer $FISCOSTORGUNIT
 * @property integer $FISCU
 * @property integer $FISUNION
 * @property integer $FISHRORGUNIT
 * @property string $FCREATORID
 * @property string $FCREATETIME
 * @property string $FLASTUPDATEUSERID
 * @property string $FLASTUPDATETIME
 * @property string $FCONTROLUNITID
 * @property integer $FISLEAF
 * @property integer $FLEVEL
 * @property string $FLONGNUMBER
 * @property string $FPARENTID
 * @property integer $FISSTART
 * @property integer $FISOUSEALUP
 * @property string $FDISPLAYNAME_L1
 * @property string $FDISPLAYNAME_L2
 * @property string $FDISPLAYNAME_L3
 * @property string $FVERSIONNUMBER
 * @property string $FCODE
 * @property integer $FISTRANSPORTORGUNIT
 * @property integer $FISQUALITYORGUNIT
 * @property string $FORGTYPESTR
 */
class CtrlUnit extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'T_ORG_CTRLUNIT';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db_hr');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['FID'], 'required'],
            [['FISGROUPING', 'FISFREEZE', 'FISCOMPANYORGUNIT', 'FISADMINORGUNIT', 'FISSALEORGUNIT', 'FISPURCHASEORGUNIT', 'FISSTORAGEORGUNIT', 'FISPROFITORGUNIT', 'FISCOSTORGUNIT', 'FISCU', 'FISUNION', 'FISHRORGUNIT', 'FISLEAF', 'FLEVEL', 'FISSTART', 'FISOUSEALUP', 'FISTRANSPORTORGUNIT', 'FISQUALITYORGUNIT'], 'integer'],
            [['FEFFECTDATE', 'FINVALIDDATE', 'FCREATETIME', 'FLASTUPDATETIME'], 'safe'],
            [['FID', 'FCREATORID', 'FLASTUPDATEUSERID', 'FCONTROLUNITID', 'FPARENTID'], 'string', 'max' => 44],
            [['FNAME_L1', 'FNAME_L2', 'FNAME_L3', 'FDESCRIPTION_L1', 'FDESCRIPTION_L2', 'FDESCRIPTION_L3', 'FORGTYPESTR'], 'string', 'max' => 765],
            [['FNUMBER', 'FSIMPLENAME', 'FCODE'], 'string', 'max' => 240],
            [['FLONGNUMBER'], 'string', 'max' => 600],
            [['FDISPLAYNAME_L1', 'FDISPLAYNAME_L2', 'FDISPLAYNAME_L3'], 'string', 'max' => 1500],
            [['FVERSIONNUMBER'], 'string', 'max' => 3],
            [['FID', 'FID', 'FID', 'FID'], 'unique', 'targetAttribute' => ['FID', 'FID', 'FID', 'FID'], 'message' => 'The combination of  and Fid has already been taken.'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'FID' => Yii::t('kingdee', 'Fid'),
            'FNAME_L1' => Yii::t('kingdee', 'Fname  L1'),
            'FNAME_L2' => Yii::t('kingdee', 'Fname  L2'),
            'FNAME_L3' => Yii::t('kingdee', 'Fname  L3'),
            'FNUMBER' => Yii::t('kingdee', 'Fnumber'),
            'FDESCRIPTION_L1' => Yii::t('kingdee', 'Fdescription  L1'),
            'FDESCRIPTION_L2' => Yii::t('kingdee', 'Fdescription  L2'),
            'FDESCRIPTION_L3' => Yii::t('kingdee', 'Fdescription  L3'),
            'FSIMPLENAME' => Yii::t('kingdee', 'Fsimplename'),
            'FISGROUPING' => Yii::t('kingdee', 'Fisgrouping'),
            'FEFFECTDATE' => Yii::t('kingdee', 'Feffectdate'),
            'FINVALIDDATE' => Yii::t('kingdee', 'Finvaliddate'),
            'FISFREEZE' => Yii::t('kingdee', 'Fisfreeze'),
            'FISCOMPANYORGUNIT' => Yii::t('kingdee', 'Fiscompanyorgunit'),
            'FISADMINORGUNIT' => Yii::t('kingdee', 'Fisadminorgunit'),
            'FISSALEORGUNIT' => Yii::t('kingdee', 'Fissaleorgunit'),
            'FISPURCHASEORGUNIT' => Yii::t('kingdee', 'Fispurchaseorgunit'),
            'FISSTORAGEORGUNIT' => Yii::t('kingdee', 'Fisstorageorgunit'),
            'FISPROFITORGUNIT' => Yii::t('kingdee', 'Fisprofitorgunit'),
            'FISCOSTORGUNIT' => Yii::t('kingdee', 'Fiscostorgunit'),
            'FISCU' => Yii::t('kingdee', 'Fiscu'),
            'FISUNION' => Yii::t('kingdee', 'Fisunion'),
            'FISHRORGUNIT' => Yii::t('kingdee', 'Fishrorgunit'),
            'FCREATORID' => Yii::t('kingdee', 'Fcreatorid'),
            'FCREATETIME' => Yii::t('kingdee', 'Fcreatetime'),
            'FLASTUPDATEUSERID' => Yii::t('kingdee', 'Flastupdateuserid'),
            'FLASTUPDATETIME' => Yii::t('kingdee', 'Flastupdatetime'),
            'FCONTROLUNITID' => Yii::t('kingdee', 'Fcontrolunitid'),
            'FISLEAF' => Yii::t('kingdee', 'Fisleaf'),
            'FLEVEL' => Yii::t('kingdee', 'Flevel'),
            'FLONGNUMBER' => Yii::t('kingdee', 'Flongnumber'),
            'FPARENTID' => Yii::t('kingdee', 'Fparentid'),
            'FISSTART' => Yii::t('kingdee', 'Fisstart'),
            'FISOUSEALUP' => Yii::t('kingdee', 'Fisousealup'),
            'FDISPLAYNAME_L1' => Yii::t('kingdee', 'Fdisplayname  L1'),
            'FDISPLAYNAME_L2' => Yii::t('kingdee', 'Fdisplayname  L2'),
            'FDISPLAYNAME_L3' => Yii::t('kingdee', 'Fdisplayname  L3'),
            'FVERSIONNUMBER' => Yii::t('kingdee', 'Fversionnumber'),
            'FCODE' => Yii::t('kingdee', 'Fcode'),
            'FISTRANSPORTORGUNIT' => Yii::t('kingdee', 'Fistransportorgunit'),
            'FISQUALITYORGUNIT' => Yii::t('kingdee', 'Fisqualityorgunit'),
            'FORGTYPESTR' => Yii::t('kingdee', 'Forgtypestr'),
        ];
    }
}
